city=["北京","上海","广东"]
for i in city:
    if len(city)<=31:
        ct = input("请输入一个省会城市名：")
        city.append(ct)
        print(city)
city.remove("广东")
city.insert(1,"广东")
print(city)
sum=0
GDP=[36710.36,35427.10,29863.23,29667.39,27665.36,27650.45,27620.38,25369.20]
for i in GDP:
    sum=sum+i
print("GDP总和为:%f" %sum)
print("平均GDP为:",sum/8)